using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

using Kypris2.CoreElements;
using Jamila2.Tools;

namespace GonzalesCore.CoreElements
{
    public enum TypeOfClaimLimitDuration { NoLimit, Daily, Weekly, Monthly, CalendarYearly, FiscalYearly, PerEvent };
    public enum YearlyLimitType { NotApplicable, Physical, Calendar };
    public enum CreditCardMode { PaidByEmployee = 0, PaidByCompany };

    #region GLClaimType
    public class GLClaimType : ClaimType
    {
        public string ActualName = "";
        public bool HavingExtraInput = false;
        // only apply to specifc individual
        public string ClaimLimitCurrency = "";
        public decimal ClaimLimit = 0;
        public TypeOfClaimLimitDuration LimitDuration = TypeOfClaimLimitDuration.NoLimit; // by default;        
        public bool Strict = false;
        public new CategoryOfClaim Category = CategoryOfClaim.General;
        //added by agnes[15march2010] - requested by covidien (china)
        public bool PerDiem = false;
        // Added by thangnv on 2013/10/12
        public new PopupTypeGLAccount PopupType = PopupTypeGLAccount.None;

        public GLClaimType(string InternalID, string DisplayName, string GLCode)
            : base(InternalID, DisplayName, GLCode)
        {
            
        }
    }

    public class GLClaimTypes : CollectionBase
    {
        public SystemUser SpecificUser = null;

        public GLClaimType this[int index]
        {
            get { return ((GLClaimType)List[index]); }
            set { List[index] = value; }
        }

        public int Add(GLClaimType value)
        {
            return (List.Add(value));
        }

        public int IndexOf(GLClaimType value)
        {
            return (List.IndexOf(value));
        }

        public void Insert(int index, GLClaimType value)
        {
            List.Insert(index, value);
        }

        public void Remove(GLClaimType value)
        {
            List.Remove(value);
        }

        public bool Contains(GLClaimType value)
        {
            // If value is not of type Int16, this will return false.
            return (List.Contains(value));
        }
    }
    #endregion

    // Added by thangnv on 2013/09/26
    #region GLAccountPopupType
    public class GLAccountPopupType : ClaimType
    {
        public string PopupType = string.Empty;        

        public GLAccountPopupType(string InternalID, string DisplayName, string GLCode)
            : base(InternalID, DisplayName, GLCode)
        {

        }
    }

    public class GLAccountPopupTypes : CollectionBase
    {
        public GLAccountPopupType this[int index]
        {
            get { return ((GLAccountPopupType)List[index]); }
            set { List[index] = value; }
        }

        public int Add(GLAccountPopupType value)
        {
            return (List.Add(value));
        }

        public int IndexOf(GLAccountPopupType value)
        {
            return (List.IndexOf(value));
        }

        public void Insert(int index, GLAccountPopupType value)
        {
            List.Insert(index, value);
        }

        public void Remove(GLAccountPopupType value)
        {
            List.Remove(value);
        }

        public bool Contains(GLAccountPopupType value)
        {
            // If value is not of type Int16, this will return false.
            return (List.Contains(value));
        }
    }
    #endregion

    #region Deparment
    public class Deparment : MasterBase
    {
        string ProfitCenterCode = "";

        public Deparment(string uid, string dname)
            : base(uid, dname)
        {
        }

        public Deparment(string uid, string dname, string Code)
            : base(uid, dname)
        {
            this.ProfitCenterCode = Code;
        }
    }
    #endregion

    #region Language
    public class Language : MasterBase {

        public string Code = "";

        public Language(string InternalID, string DisplayName)
            : base(InternalID, DisplayName)
        {
        }

        public Language(string InternalID, string DisplayName, string Code)
            : base(InternalID, DisplayName)
        {
            this.Code = Code;
        }

        public Language(string InternalID, string DisplayName, string Code, int Order)
            : base(InternalID, DisplayName)
        {
            this.Code = Code;
            this.Order = Order;
            
        }
    }
    #endregion

    #region Entity
    public class Entity : MasterBase
    {
        public string BPCS = "";
        public TypeOfCreditCardPayment CreditCardPaymentType = TypeOfCreditCardPayment.PaidByCompany;

        public Entity(string InternalID, string DisplayName) 
            : base (InternalID, DisplayName)
        {

        }

        public Entity(string InternalID, string DisplayName, int Order)
            : base(InternalID, DisplayName)
        {            
            this.Order = Order;
        }
    }
    #endregion       

    #region Project
    public class Project : MasterBase
    {
        public string EntityID = "";
        public string ProjectID = "";
        public string ProjectDescription = "";
        public string ProjectType = "";

        public Project(string InternalID)
            : base(InternalID, "")
        {

        }
    }
    #endregion  

    #region ProfitCenter
    public class ProfitCenter : MasterBase
    {
        public string EntityID = string.Empty;
        public string ProfitcenterCode = string.Empty;
        public string ProfitcenterDescription = string.Empty;

        public ProfitCenter(string ProfitcenterCode, string ProfitcenterDescription)
            : base(ProfitcenterCode, ProfitcenterDescription)
        {

        }
    }
    #endregion  

    #region CRMOD_TYPE
    public class CRMOD_TYPE : MasterBase
    {
        public string EntityID = string.Empty;
        public string CompanyCode = string.Empty;
        public string Flag = "0";

        public CRMOD_TYPE()
            : base("", "")
        {

        }
    }
    #endregion 
 
    #region CRMOD
    public class CRMOD : MasterBase
    {
        public string EntityID = string.Empty;
        public string ProjectID = string.Empty;
        public string EmployeeCode = string.Empty;
        public string ProjectName = string.Empty;

        public CRMOD()
            : base("", "")
        {

        }
    }
    #endregion 

}
